<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2022-11-04 15:08:12
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-04 15:43:26
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <table>
        <thead>
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>籍贯</th>
            </tr>
        </thead>
        <tbody>
            
        </tbody>
    </table>

    <script>
        var users = [{
                id: 1,
                name: '张三',
                age: 18,
                gender: '男',
                address: '山东济南'
            },
            {
                id: 2,
                name: '李三',
                age: 19,
                gender: '男',
                address: '山东青岛'
            },
            {
                id: 3,
                name: '赵三',
                age: 20,
                gender: '男',
                address: '山东潍坊'
            },
            {
                id: 4,
                name: '郭三',
                age: 21,
                gender: '男',
                address: '山东枣庄'
            },
            {
                id: 5,
                name: '孙三',
                age: 17,
                gender: '女',
                address: '山东济宁'
            },
            {
                id: 6,
                name: '魏三',
                age: 20,
                gender: '女',
                address: '湖北荆州'
            },
            {
                id: 7,
                name: '诸三',
                age: 19,
                gender: '男',
                address: '山东淄博'
            },
            {
                id: 8,
                name: '胡三',
                age: 18,
                gender: '男',
                address: '山东章丘'
            }

        ];
        var str = '';
        users.forEach(function(item){
            str += `<tr>
                <td>${item.id}</td>
                <td>${item.name}</td>
                <td>${item.age}</td>
                <td>${item.gender}</td>
                <td>${item.address}</td>
            </tr>`;
        });
        var tbodyEle = document.querySelector('tbody');

        tbodyEle.innerHTML = str;


    </script>
</body>

</html>